package services;

public class PongProxy implements services.Pong {
  private String _endpoint = null;
  private services.Pong pong = null;
  
  public PongProxy() {
    _initPongProxy();
  }
  
  public PongProxy(String endpoint) {
    _endpoint = endpoint;
    _initPongProxy();
  }
  
  private void _initPongProxy() {
    try {
      pong = (new services.PongServiceLocator()).getPong();
      if (pong != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)pong)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)pong)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (pong != null)
      ((javax.xml.rpc.Stub)pong)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public services.Pong getPong() {
    if (pong == null)
      _initPongProxy();
    return pong;
  }
  
  public java.lang.String ping(java.lang.String ping) throws java.rmi.RemoteException{
    if (pong == null)
      _initPongProxy();
    return pong.ping(ping);
  }
  
  
}